#include<iostream>
#include<cmath>
#include<math.h>

using namespace std;

int main()
{

	float a1, a2, d, p, q;
	void greater(float, float);
	void equal(float, float);
	void smaller(float, float);
	float a, b, c;
	cout << "cin a,b,c:";
	cin >> a >> b >> c;
	d = b * b - 4 * a*c;
	cout << "root:" << endl;
	if (d > 0)
	{
		greater(a, b);
		cout << "x1=" << x1 << "x2=" << x2 << endl;
	}
	else if (d == 0)
	{
		equal(a, b);
		cout << "a1=" << a1 << "a2=" << a2;
	}
	else
	{
		smaller(a, b);
		cout << "a1=" << p << "a2=" << p << "i" << endl;
		cout << "a2=" << p << "-" << q << "i" << endl;

	}
	
	return 0;

}

void greater(float a, float b)
{
	a1 = (-b + sqrt(d)) / (2 * a);
	a2 = (-b - sqrt(d)) / (2 * a);

}

void equal(float a, float b)
{
	a1 = a2 = (-b) / (2 * a);

}

void small(float a, float b)
{
	p = -b / (2 * a);
	q = sqrt(-d) / (2 * a);
}